﻿// -----------------------------------------------------------------------
// <copyright file="Sub.cs" company="Microsoft">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Proto
{
    using System;

    [Flags]
    public enum SubState
    {
        Uninitialized = 0,
        PendingRequest = 1 << 1,
        InBatch = 1 << 2,
        UpdatePending = 1 << 3,
        Ready = 1 << 4,
    }

    
    public delegate void UpdateNotice<T_OBJ >( 
                            T_OBJ new_state, 
                            T_OBJ old_state, 
                            int index );

    public delegate void AdditionNotice<in T>(T addition, int index);

    public delegate void RemovalNotice<in T>(T removal, int index);

    public delegate void UpdateDelegate<T_OBJ >( 
                            ISubItem<T_OBJ> source, 
                            // NOTE: Do we need dirty logic?
                            // FieldSet changed,
                            T_OBJ new_state, 
                            T_OBJ old_state );
}
